//
//  LocationManagement.h
//  GainProfit
//
//  Created by Sky-TechLab on 11/4/13.
//  Copyright (c) 2013 Jason.wu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
#import <BaiduMapAPI_Utils/BMKUtilsComponent.h>
#import <BaiduMapAPI_Map/BMKMapComponent.h>
#import <BaiduMapAPI_Search/BMKSearchComponent.h>
#import <BaiduMapAPI_Location/BMKLocationComponent.h>
//#import <BaiduMapAPI/BMapKit.h>

@protocol LocationManagementDelegate <NSObject>

@optional
- (void)locationUpdated;
- (void)locationUpdatedFailed:(int)errorCode ErrorMessage:(NSString *)message;

@end

@interface LocationManagement : NSObject<CLLocationManagerDelegate, BMKMapViewDelegate, BMKGeoCodeSearchDelegate, BMKLocationServiceDelegate>
{
@private
    CLLocationManager *_locationManager;
    CLGeocoder *_geocoder;
    //MKPlacemark *_placemark;
    //CLLocation *_location;
    BMKMapView* _mapView;
    BMKGeoCodeSearch* _geocodesearch;
    BMKLocationService* _locService;
}

@property (nonatomic,strong) MKPlacemark *placemark;
@property (nonatomic,strong) CLLocation *location;
@property (nonatomic, strong) NSString *city;

@property (nonatomic) id<LocationManagementDelegate> delegate;

+ (LocationManagement *)sharedInstance;
- (void)performCoordinateGeocode:(CLLocationCoordinate2D)coordinate success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failre;
//{{baidu
@property (nonatomic, strong) NSString *address;
//}}
- (void) startGPS;
- (void) startUpdatingLocation;
- (void) stopGPS;
@end
